package metier.Service;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.*;

import metier.entities.CalculEstimation;
import metier.entities.Transport;
import metier.sess.ICalculEstimationLocal;



@Stateless
@WebService
public class CalculeService {
		
		
		@EJB(beanName="CIMP")
		private ICalculEstimationLocal metier;
		
		
		@WebMethod
		public void addCalcule(@WebParam(name="distance")Double distance,@WebParam(name="poids")Double poids,@WebParam(name="prix")Float prix,@WebParam(name="statut")boolean statut)
		{
			//CalculEstimation ce=new CalculEstimation(distance, poids, prix, statut);
			//metier.addCalcule(ce);
		}
		
		@WebMethod
		public List<CalculEstimation> listCalcule()
		{
			return metier.getAllCalcule();
		}
		
		
		@WebMethod 
		public CalculEstimation getCalcule(@WebParam(name="Id")Integer Id)
		{
			return metier.getCalcule(Id);
		}
		
		@WebMethod 
		public List<Transport> list(@WebParam(name="Id")Integer Id)
		{
			CalculEstimation c=metier.getCalcule(Id);
			return c.getListTransport();
		}
		
		@WebMethod
		public void UpdateCategorie(@WebParam(name="Id")Integer Id,@WebParam(name="distance")Double distance,@WebParam(name="poids")Double poids,@WebParam(name="prix")Float prix,@WebParam(name="statut")boolean statut)
		{
		
			/*CalculEstimation ce=metier.getCalcule(Id);
			ce.setDistance(distance);
			ce.setPoids(poids);
			ce.setPrix(prix);
	        ce.setStatut(statut);
			metier.updateCalcule(ce);*/
			
		}
		
		
		@WebMethod
		public void DeleteCategorie(@WebParam(name="Id")Integer Id)
		{
			metier.deleteCalcule(Id);
		}



}




